package com.scy.java.loop;

public class WhileDemo01 {
    public static void main(String[] args) {
        //计算1-100之间的所有偶数和
        int i = 0 ;
        int num = 0 ;
        int t = 0;
        while (i<=100){
           if (i%2==0){
               num+=i;
               t++;

           }

           i++;

        }
        System.out.println("偶数和为"+num);
        System.out.println("偶数的个数为："+t);
    }
}
